package utp.tepc.usina;

/**
 * @author Jackson
 * @version 1.0
 * @created 09-jun-2011 20:30:38
 */
public class Monitor implements Observer
{
    private void exibir(Object obj)
    {
	ValObjInfoOporeacao infos = (ValObjInfoOporeacao)obj;
	String equalizar = infos.turnos > 0 ? String.format(" | Equalizando por: %d | %s", infos.turnos, infos.equalizacao) : "";
	
	System.out.println(String.format("Reator: %s | Pressao: %.2f | Temperatura: %.2f | %s%s", infos.idReator, infos.pressao, infos.temperatura, infos.estado, equalizar));
    }

    @Override
    public void update(Object args)
    {
	if (args instanceof ValObjInfoOporeacao)
	    this.exibir(args);
    }
}